package models.vo {

  import org.restfulx.collections.ModelsCollection;
  import org.restfulx.models.RxModel;

  [Resource(name="documentos_fiscais")]

  [Bindable]
  public class DocumentoFiscal extends RxModel {

    public static const LABEL:String = "numero";

    public var numero:String = "";

    public var razaoSocial:String = "";

    public var cnpj:String = "";

    public var data:Date;

    public var valor:Number = 0;

    [HasMany]
    public var investimentos:ModelsCollection;

    [Ignored]
    public function get numeroEditado():String {
      return (numero == "") ? "" : ((cnpj == "") ? "DI " + numero : "NF " + numero);
    }

    public function DocumentoFiscal() {
      super(LABEL);
    }

  }
}
